package day9;
import java.io.*;
/**
 * @author oldliu
 * @since 1.0
 */
public class BuffReaderTest {
    public static void main(String[] args) {
        try {
            //大文件，加一个缓冲区大小
//            BufferedReader br=new BufferedReader(new FileReader("D:\\\\Documents\\\\桌面\\\\78-introduction.txt"));
//            String str=null;
//            int k=0;
//            while ((str=br.readLine())!=null){
//                System.out.println(++k+":"+str);
//            }
//            br.close();

            //BufferedWriter bw=new BufferedWriter(new FileWriter("D:\\Documents\\桌面\\222.txt"));

            //PrintWriter  byte=>char
            BufferedWriter bw=new BufferedWriter(new PrintWriter(new FileOutputStream("D:\\Documents\\桌面\\222.txt")));

            for (int i = 0; i <20 ; i++) {
                bw.write("你好，我是渣渣灰"+i);

                bw.newLine();//换行
            }
            System.out.println("写入成功");
            bw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
